Add format-string-without-interpolation checker#4794
Conversation
This adds a checker that checks strings with '%' or format() applied to them. If no variables to be replaced are found the warning is emitted. Closes pylint-dev#4042
|
I'm not sure how to handle the failing check in |
Pierre-Sassoulas
left a comment
There was a problem hiding this comment.
Look good ! I only have a small comment.
|
Regarding config init : Very good news we discovered a problem in pylint with this new checker ? 😄 I think we can remove globals() from this string (to keep the same behavior at least). I think this would help during debug but clearly no one used this in a long time or we'd have a bug report at this point. |
Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
|
This is probably me not understanding how old_names work, but now all tests are failing as all |
|
Ho no sorry my bad. It's not possible to rename only a part of it. We'd have to rename both. It means we'd need to rename |
|
Hmm |
|
Another way would be to refactor the MessageIdStore so it's possible to partially rename a message. I think the consequences is that you'd need to instantly rename all the messages that need to be renamed when partially renaming a message or you'd get the old name (kinda defeating the purpose of it in the first place). Beside if you have a |
|
No problem, I can imagine why you wanted to add |
for more information, see https://pre-commit.ci
Pierre-Sassoulas
left a comment
There was a problem hiding this comment.
Thank you for reverting ! 👍
|
Not that I care too much about it, but it seems like the Copyright lines at the top of a document are not updated automatically. Should I create a PR to do so? |
|
It's done automatically but during release (check |
|
Ah okay! Don't really have a better solution, but will keep my eyes open! |
doc/whatsnew/<current release.rst>.Type of Changes
Description
This adds a checker that checks strings with '%' or format() applied to them.
If no variables to be replaced are found the warning is emitted.
Closes #4042